﻿using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;

namespace CRM.Infrastructure.EFCore.Mysql
{
    public partial class examContext : DbContext
    {
        public examContext()
        {
        }

        public examContext(DbContextOptions<examContext> options)
            : base(options)
        {
        }

        public virtual DbSet<ExamArrange> ExamArranges { get; set; } = null!;
        public virtual DbSet<ExamArrangeOrg> ExamArrangeOrgs { get; set; } = null!;
        public virtual DbSet<ExamLikequestion> ExamLikequestions { get; set; } = null!;
        public virtual DbSet<ExamOption> ExamOptions { get; set; } = null!;
        public virtual DbSet<ExamQuestion> ExamQuestions { get; set; } = null!;
        public virtual DbSet<ExamQuestionbank> ExamQuestionbanks { get; set; } = null!;
        public virtual DbSet<ExamQuestionbankdetail> ExamQuestionbankdetails { get; set; } = null!;
        public virtual DbSet<ExamResult> ExamResults { get; set; } = null!;
        public virtual DbSet<ExamResultDetail> ExamResultDetails { get; set; } = null!;
        public virtual DbSet<ExamTestpaper> ExamTestpapers { get; set; } = null!;
        public virtual DbSet<ExamTestpaperdetail> ExamTestpaperdetails { get; set; } = null!;
        public virtual DbSet<ExamWrongQuestion> ExamWrongQuestions { get; set; } = null!;
        public virtual DbSet<Statistic> Statistics { get; set; } = null!;
        public virtual DbSet<SysActionLog> SysActionLogs { get; set; } = null!;
        public virtual DbSet<SysDepartment> SysDepartments { get; set; } = null!;
        public virtual DbSet<SysDepartmentDuty> SysDepartmentDuties { get; set; } = null!;
        public virtual DbSet<SysDuty> SysDuties { get; set; } = null!;
        public virtual DbSet<SysErrorLog> SysErrorLogs { get; set; } = null!;
        public virtual DbSet<SysLoginLog> SysLoginLogs { get; set; } = null!;
        public virtual DbSet<SysRight> SysRights { get; set; } = null!;
        public virtual DbSet<SysRightConfig> SysRightConfigs { get; set; } = null!;
        public virtual DbSet<SysRightConfigDetail> SysRightConfigDetails { get; set; } = null!;
        public virtual DbSet<SysRightConfigOrg> SysRightConfigOrgs { get; set; } = null!;
        public virtual DbSet<SysUploadFile> SysUploadFiles { get; set; } = null!;
        public virtual DbSet<SysUser> SysUsers { get; set; } = null!;
        public virtual DbSet<SysUserInfo> SysUserInfos { get; set; } = null!;
        public virtual DbSet<SysUserPoint> SysUserPoints { get; set; } = null!;
        public virtual DbSet<SysUserPointhistory> SysUserPointhistories { get; set; } = null!;
        public virtual DbSet<SysUserRight> SysUserRights { get; set; } = null!;
        public virtual DbSet<SysVerify> SysVerifies { get; set; } = null!;

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            if (!optionsBuilder.IsConfigured)
            {
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see http://go.microsoft.com/fwlink/?LinkId=723263.
                optionsBuilder.UseMySql("server=localhost;user id=root;password=123456;database=exam", Microsoft.EntityFrameworkCore.ServerVersion.Parse("8.0.40-mysql"));
            }
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.UseCollation("utf8mb4_0900_ai_ci")
                .HasCharSet("utf8mb4");

            modelBuilder.Entity<ExamArrange>(entity =>
            {
                entity.HasKey(e => e.AId)
                    .HasName("PRIMARY");

                entity.ToTable("exam_arrange");

                entity.HasComment("考试安排表")
                    .UseCollation("utf8mb4_general_ci");

                entity.Property(e => e.AId)
                    .HasMaxLength(32)
                    .HasColumnName("A_ID")
                    .HasComment("安排ID");

                entity.Property(e => e.AAuthor)
                    .HasMaxLength(32)
                    .HasColumnName("A_Author")
                    .HasComment("作者ID");

                entity.Property(e => e.ABeginTime)
                    .HasColumnType("datetime")
                    .HasColumnName("A_BeginTime")
                    .HasComment("开始时间");

                entity.Property(e => e.AChcekPerson)
                    .HasMaxLength(32)
                    .HasColumnName("A_Chcek_Person")
                    .HasComment("阅卷人ID");

                entity.Property(e => e.ACreatetime)
                    .HasColumnType("datetime")
                    .HasColumnName("A_Createtime")
                    .HasComment("创建时间");

                entity.Property(e => e.ADesc)
                    .HasMaxLength(255)
                    .HasColumnName("A_Desc");

                entity.Property(e => e.AEndTime)
                    .HasColumnType("datetime")
                    .HasColumnName("A_EndTime")
                    .HasComment("结束时间");

                entity.Property(e => e.AExplain)
                    .HasMaxLength(255)
                    .HasColumnName("A_Explain")
                    .HasComment("描述");

                entity.Property(e => e.AIsCheck)
                    .HasColumnName("A_IsCheck")
                    .HasComment("是否需要阅卷");

                entity.Property(e => e.AIsFinish)
                    .HasColumnName("A_IsFinish")
                    .HasComment("是否完成");

                entity.Property(e => e.AName)
                    .HasMaxLength(50)
                    .HasColumnName("A_Name")
                    .HasComment("名称");

                entity.Property(e => e.ATpId)
                    .HasMaxLength(32)
                    .HasColumnName("A_TP_ID")
                    .HasComment("试卷ID");
            });

            modelBuilder.Entity<ExamArrangeOrg>(entity =>
            {
                entity.HasKey(e => e.AoId)
                    .HasName("PRIMARY");

                entity.ToTable("exam_arrange_org");

                entity.Property(e => e.AoId)
                    .HasMaxLength(32)
                    .HasColumnName("AO_ID");

                entity.Property(e => e.AoAId)
                    .HasMaxLength(32)
                    .HasColumnName("AO_A_ID");

                entity.Property(e => e.AoBeginTime)
                    .HasColumnType("datetime")
                    .HasColumnName("AO_BeginTime");

                entity.Property(e => e.AoDeptId)
                    .HasMaxLength(32)
                    .HasColumnName("AO_Dept_ID");

                entity.Property(e => e.AoEndTime)
                    .HasColumnType("datetime")
                    .HasColumnName("AO_EndTime");

                entity.Property(e => e.AoUId)
                    .HasMaxLength(32)
                    .HasColumnName("AO_U_ID");
            });

            modelBuilder.Entity<ExamLikequestion>(entity =>
            {
                entity.HasKey(e => e.Lqid)
                    .HasName("PRIMARY");

                entity.ToTable("exam_likequestion");

                entity.UseCollation("utf8mb4_general_ci");

                entity.Property(e => e.Lqid)
                    .HasMaxLength(32)
                    .HasColumnName("LQID")
                    .HasComment("收藏ID");

                entity.Property(e => e.Lqcid)
                    .HasMaxLength(32)
                    .HasColumnName("LQCID")
                    .HasComment("章节ID");

                entity.Property(e => e.LqcreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("LQCreateTime")
                    .HasComment("收藏时间");

                entity.Property(e => e.Lqqid)
                    .HasMaxLength(32)
                    .HasColumnName("LQQID")
                    .HasComment("题目ID");

                entity.Property(e => e.Lquid)
                    .HasMaxLength(32)
                    .HasColumnName("LQUID")
                    .HasComment("用户ID");
            });

            modelBuilder.Entity<ExamOption>(entity =>
            {
                entity.HasKey(e => e.OId)
                    .HasName("PRIMARY");

                entity.ToTable("exam_options");

                entity.HasComment("选项表")
                    .UseCollation("utf8mb4_general_ci");

                entity.Property(e => e.OId)
                    .HasMaxLength(32)
                    .HasColumnName("O_ID")
                    .HasComment("编号");

                entity.Property(e => e.OContent)
                    .HasMaxLength(999)
                    .HasColumnName("O_Content")
                    .HasComment("答案内容");

                entity.Property(e => e.OIsRight)
                    .HasColumnName("O_IsRight")
                    .HasComment("是否正确答案");

                entity.Property(e => e.OQId)
                    .HasMaxLength(32)
                    .HasColumnName("O_Q_ID")
                    .HasComment("题目编号");
            });

            modelBuilder.Entity<ExamQuestion>(entity =>
            {
                entity.HasKey(e => e.QId)
                    .HasName("PRIMARY");

                entity.ToTable("exam_questions");

                entity.HasComment("试题表")
                    .UseCollation("utf8mb4_general_ci");

                entity.Property(e => e.QId)
                    .HasMaxLength(32)
                    .HasColumnName("Q_ID")
                    .HasComment("编号");

                entity.Property(e => e.QAnswer)
                    .HasMaxLength(500)
                    .HasColumnName("Q_Answer")
                    .HasComment("参考答案");

                entity.Property(e => e.QAuthor)
                    .HasMaxLength(32)
                    .HasColumnName("Q_Author")
                    .HasComment("作者");

                entity.Property(e => e.QContent)
                    .HasMaxLength(999)
                    .HasColumnName("Q_Content")
                    .HasComment("题干");

                entity.Property(e => e.QCreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("Q_CreateTime")
                    .HasComment("创建时间");

                entity.Property(e => e.QDesc)
                    .HasMaxLength(255)
                    .HasColumnName("Q_Desc");

                entity.Property(e => e.QExplain)
                    .HasMaxLength(999)
                    .HasColumnName("Q_Explain")
                    .HasComment("描述");

                entity.Property(e => e.QIsBan)
                    .HasColumnName("Q_IsBan")
                    .HasComment("是否禁用");

                entity.Property(e => e.QIsPublish)
                    .HasColumnName("Q_IsPublish")
                    .HasComment("是否发布");

                entity.Property(e => e.QLabel)
                    .HasMaxLength(500)
                    .HasColumnName("Q_Label")
                    .HasComment("题目标签");

                entity.Property(e => e.QLv)
                    .HasColumnName("Q_Lv")
                    .HasComment("难度等级");

                entity.Property(e => e.QType)
                    .HasColumnName("Q_Type")
                    .HasComment("类型 1/选择题,2/简答题,3/填空题");

                entity.Property(e => e.QUseCount)
                    .HasColumnName("Q_UseCount")
                    .HasComment("使用次数");
            });

            modelBuilder.Entity<ExamQuestionbank>(entity =>
            {
                entity.HasKey(e => e.Qbid)
                    .HasName("PRIMARY");

                entity.ToTable("exam_questionbank");

                entity.HasComment("题库表")
                    .UseCollation("utf8mb4_general_ci");

                entity.Property(e => e.Qbid)
                    .HasMaxLength(32)
                    .HasColumnName("QBID")
                    .HasComment("题库ID");

                entity.Property(e => e.Qbcount)
                    .HasColumnName("QBCount")
                    .HasComment("题目数量");

                entity.Property(e => e.QbcreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("QBCreateTime")
                    .HasComment("创建时间");

                entity.Property(e => e.Qbdesc)
                    .HasMaxLength(255)
                    .HasColumnName("QBDesc")
                    .HasComment("备用");

                entity.Property(e => e.Qbexplain)
                    .HasMaxLength(200)
                    .HasColumnName("QBExplain")
                    .HasComment("描述");

                entity.Property(e => e.QbisBan)
                    .HasColumnName("QBIsBan")
                    .HasComment("是否禁用");

                entity.Property(e => e.QbisPublish)
                    .HasColumnName("QBIsPublish")
                    .HasComment("是否发布");

                entity.Property(e => e.Qblabel)
                    .HasMaxLength(100)
                    .HasColumnName("QBLabel")
                    .HasComment("题库标签");

                entity.Property(e => e.Qblv)
                    .HasColumnName("QBLv")
                    .HasComment("等级");

                entity.Property(e => e.Qbname)
                    .HasMaxLength(50)
                    .HasColumnName("QBName")
                    .HasComment("题库名");

                entity.Property(e => e.Qbparent)
                    .HasMaxLength(32)
                    .HasColumnName("QBParent")
                    .HasComment("上级题库ID");
            });

            modelBuilder.Entity<ExamQuestionbankdetail>(entity =>
            {
                entity.HasKey(e => e.Qbdid)
                    .HasName("PRIMARY");

                entity.ToTable("exam_questionbankdetails");

                entity.HasComment("题库详情")
                    .UseCollation("utf8mb4_general_ci");

                entity.Property(e => e.Qbdid)
                    .HasMaxLength(32)
                    .HasColumnName("QBDID")
                    .HasComment("关系ID");

                entity.Property(e => e.QbdcreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("QBDCreateTime")
                    .HasComment("创建时间");

                entity.Property(e => e.Qbdlv)
                    .HasColumnName("QBDLv")
                    .HasComment("题目难度");

                entity.Property(e => e.Qbdqbid)
                    .HasMaxLength(32)
                    .HasColumnName("QBDQBID")
                    .HasComment("题库ID");

                entity.Property(e => e.Qbdqid)
                    .HasMaxLength(32)
                    .HasColumnName("QBDQID")
                    .HasComment("题目ID");
            });

            modelBuilder.Entity<ExamResult>(entity =>
            {
                entity.HasKey(e => e.RId)
                    .HasName("PRIMARY");

                entity.ToTable("exam_result");

                entity.HasComment("考试答题卡")
                    .UseCollation("utf8mb4_general_ci");

                entity.Property(e => e.RId)
                    .HasMaxLength(32)
                    .HasColumnName("R_ID")
                    .HasComment("答题卡ID");

                entity.Property(e => e.RAId)
                    .HasMaxLength(32)
                    .HasColumnName("R_A_ID")
                    .HasComment("安排ID");

                entity.Property(e => e.RCheckPerson)
                    .HasMaxLength(32)
                    .HasColumnName("R_Check_Person")
                    .HasComment("阅卷人ID");

                entity.Property(e => e.RCreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("R_CreateTime")
                    .HasComment("开始答题时间");

                entity.Property(e => e.RDesc)
                    .HasMaxLength(255)
                    .HasColumnName("R_Desc")
                    .HasComment("备用字段");

                entity.Property(e => e.RExplain)
                    .HasMaxLength(255)
                    .HasColumnName("R_Explain")
                    .HasComment("描述/是否缺考等");

                entity.Property(e => e.RFinishTime)
                    .HasColumnType("datetime")
                    .HasColumnName("R_FinishTime")
                    .HasComment("交卷时间");

                entity.Property(e => e.RIsAbsent)
                    .HasColumnName("R_IsAbsent")
                    .HasComment("是否缺考");

                entity.Property(e => e.RIsCheck)
                    .HasColumnName("R_IsCheck")
                    .HasComment("是否阅卷");

                entity.Property(e => e.RScore)
                    .HasColumnName("R_Score")
                    .HasComment("分数");

                entity.Property(e => e.RUId)
                    .HasMaxLength(32)
                    .HasColumnName("R_U_ID")
                    .HasComment("用户ID");
            });

            modelBuilder.Entity<ExamResultDetail>(entity =>
            {
                entity.HasKey(e => e.RdId)
                    .HasName("PRIMARY");

                entity.ToTable("exam_result_details");

                entity.HasComment("答题卡详情")
                    .UseCollation("utf8mb4_general_ci");

                entity.Property(e => e.RdId)
                    .HasMaxLength(32)
                    .HasColumnName("RD_ID")
                    .HasComment("答题卡详情ID");

                entity.Property(e => e.RdAnswer)
                    .HasMaxLength(999)
                    .HasColumnName("RD_Answer")
                    .HasComment("回答");

                entity.Property(e => e.RdCreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("RD_CreateTime")
                    .HasComment("时间");

                entity.Property(e => e.RdIsRight)
                    .HasColumnName("RD_IsRight")
                    .HasComment("是否正确");

                entity.Property(e => e.RdNo)
                    .HasColumnName("RD_No")
                    .HasComment("序号");

                entity.Property(e => e.RdQid)
                    .HasMaxLength(32)
                    .HasColumnName("RD_QID")
                    .HasComment("题目ID");

                entity.Property(e => e.RdRid)
                    .HasMaxLength(32)
                    .HasColumnName("RD_RID")
                    .HasComment("答题卡ID");

                entity.Property(e => e.RdScore)
                    .HasColumnName("RD_Score")
                    .HasComment("得分");
            });

            modelBuilder.Entity<ExamTestpaper>(entity =>
            {
                entity.HasKey(e => e.TpId)
                    .HasName("PRIMARY");

                entity.ToTable("exam_testpaper");

                entity.HasComment("试卷")
                    .UseCollation("utf8mb4_general_ci");

                entity.Property(e => e.TpId)
                    .HasMaxLength(32)
                    .HasColumnName("TP_ID")
                    .HasComment("试卷ID");

                entity.Property(e => e.TpAuthor)
                    .HasMaxLength(32)
                    .HasColumnName("TP_Author")
                    .HasComment("作者ID");

                entity.Property(e => e.TpCount)
                    .HasColumnName("TP_Count")
                    .HasComment("题目数量");

                entity.Property(e => e.TpCreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("TP_CreateTime")
                    .HasComment("添加时间");

                entity.Property(e => e.TpDesc)
                    .HasMaxLength(255)
                    .HasColumnName("TP_Desc");

                entity.Property(e => e.TpExplain)
                    .HasMaxLength(200)
                    .HasColumnName("TP_Explain")
                    .HasComment("描述");

                entity.Property(e => e.TpIsBan)
                    .HasColumnName("TP_IsBan")
                    .HasComment("是否禁用");

                entity.Property(e => e.TpIsCheck)
                    .HasColumnName("TP_IsCheck")
                    .HasComment("是否需要阅卷");

                entity.Property(e => e.TpIsPublish)
                    .HasColumnName("TP_IsPublish")
                    .HasComment("是否发布");

                entity.Property(e => e.TpLabels)
                    .HasMaxLength(999)
                    .HasColumnName("TP_Labels")
                    .HasComment("标签");

                entity.Property(e => e.TpLv)
                    .HasColumnName("TP_Lv")
                    .HasComment("难度");

                entity.Property(e => e.TpMode)
                    .HasColumnName("TP_Mode")
                    .HasComment("组卷模式");

                entity.Property(e => e.TpName)
                    .HasMaxLength(50)
                    .HasColumnName("TP_Name")
                    .HasComment("试卷名");

                entity.Property(e => e.TpPassScore)
                    .HasColumnName("TP_PassScore")
                    .HasComment("及格分");

                entity.Property(e => e.TpTotalScore)
                    .HasColumnName("TP_TotalScore")
                    .HasComment("总分");

                entity.Property(e => e.TpUseCount)
                    .HasColumnName("TP_UseCount")
                    .HasComment("使用次数");
            });

            modelBuilder.Entity<ExamTestpaperdetail>(entity =>
            {
                entity.HasKey(e => e.TpdId)
                    .HasName("PRIMARY");

                entity.ToTable("exam_testpaperdetails");

                entity.HasComment("试卷详情")
                    .UseCollation("utf8mb4_general_ci");

                entity.Property(e => e.TpdId)
                    .HasMaxLength(32)
                    .HasColumnName("TPD_ID")
                    .HasComment("试卷详情ID");

                entity.Property(e => e.TpdCreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("TPD_CreateTime")
                    .HasComment("时间");

                entity.Property(e => e.TpdNo)
                    .HasColumnName("TPD_No")
                    .HasComment("序号");

                entity.Property(e => e.TpdQId)
                    .HasMaxLength(32)
                    .HasColumnName("TPD_Q_ID")
                    .HasComment("题目ID");

                entity.Property(e => e.TpdScore)
                    .HasColumnName("TPD_Score")
                    .HasComment("分数");

                entity.Property(e => e.TpdTpId)
                    .HasMaxLength(32)
                    .HasColumnName("TPD_TP_ID")
                    .HasComment("试卷ID");
            });

            modelBuilder.Entity<ExamWrongQuestion>(entity =>
            {
                entity.HasKey(e => e.WqId)
                    .HasName("PRIMARY");

                entity.ToTable("exam_wrong_question");

                entity.HasComment("错题表")
                    .UseCollation("utf8mb4_general_ci");

                entity.Property(e => e.WqId)
                    .HasMaxLength(32)
                    .HasColumnName("WQ_ID")
                    .HasComment("错题ID");

                entity.Property(e => e.WqAnswer)
                    .HasMaxLength(999)
                    .HasColumnName("WQ_Answer")
                    .HasComment("错误回答");

                entity.Property(e => e.WqCreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("WQ_CreateTime")
                    .HasComment("错误时间");

                entity.Property(e => e.WqDesc)
                    .HasMaxLength(255)
                    .HasColumnName("WQ_Desc");

                entity.Property(e => e.WqIsRemove)
                    .HasColumnName("WQ_IsRemove")
                    .HasComment("是否移除");

                entity.Property(e => e.WqQid)
                    .HasMaxLength(32)
                    .HasColumnName("WQ_QID")
                    .HasComment("题目ID");

                entity.Property(e => e.WqReMoveTime)
                    .HasColumnType("datetime")
                    .HasColumnName("WQ_ReMoveTime")
                    .HasComment("移除时间");

                entity.Property(e => e.WqRelationId)
                    .HasMaxLength(32)
                    .HasColumnName("WQ_RelationID")
                    .HasComment("关联ID");

                entity.Property(e => e.WqType)
                    .HasColumnName("WQ_Type")
                    .HasComment("错题类型 1:考试");

                entity.Property(e => e.WqUid)
                    .HasMaxLength(32)
                    .HasColumnName("WQ_UID")
                    .HasComment("用户ID");
            });

            modelBuilder.Entity<Statistic>(entity =>
            {
                entity.HasKey(e => e.SId)
                    .HasName("PRIMARY");

                entity.ToTable("statistics");

                entity.Property(e => e.SId)
                    .HasMaxLength(32)
                    .HasColumnName("S_ID")
                    .HasComment("统计ID");

                entity.Property(e => e.SCreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("S_CreateTime")
                    .HasComment("添加时间");

                entity.Property(e => e.SDate)
                    .HasColumnType("datetime")
                    .HasColumnName("S_Date")
                    .HasComment("日期");

                entity.Property(e => e.SExamCount)
                    .HasColumnName("S_Exam_Count")
                    .HasComment("试卷数量");

                entity.Property(e => e.SQuestionCount)
                    .HasColumnName("S_Question_Count")
                    .HasComment("题目数量");

                entity.Property(e => e.STestpaperCount)
                    .HasColumnName("S_Testpaper_Count")
                    .HasComment("试卷数量");

                entity.Property(e => e.SUserCount)
                    .HasColumnName("S_User_Count")
                    .HasComment("用户数量");
            });

            modelBuilder.Entity<SysActionLog>(entity =>
            {
                entity.HasKey(e => e.Alid)
                    .HasName("PRIMARY");

                entity.ToTable("sys_action_logs");

                entity.HasComment("行为日志表")
                    .UseCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.Alid)
                    .HasMaxLength(32)
                    .HasColumnName("ALID");

                entity.Property(e => e.Alaction)
                    .HasMaxLength(50)
                    .HasColumnName("ALAction")
                    .HasComment("行为");

                entity.Property(e => e.AlapiUrl)
                    .HasMaxLength(200)
                    .HasColumnName("ALApiUrl")
                    .HasComment("本次请求的接口地址");

                entity.Property(e => e.AlcreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("ALCreateTime")
                    .HasComment("操作时间");

                entity.Property(e => e.Aldesc)
                    .HasMaxLength(255)
                    .HasColumnName("ALDesc")
                    .HasComment("备用");

                entity.Property(e => e.Alip)
                    .HasMaxLength(20)
                    .HasColumnName("ALIp")
                    .HasComment("本次请求的IP");

                entity.Property(e => e.Alparams)
                    .HasMaxLength(999)
                    .HasColumnName("ALParams")
                    .HasComment("本次请求的参数");

                entity.Property(e => e.Alresult)
                    .HasColumnName("ALResult")
                    .HasComment("操作结果");

                entity.Property(e => e.AlresultMessage)
                    .HasMaxLength(999)
                    .HasColumnName("ALResultMessage")
                    .HasComment("结果信息");

                entity.Property(e => e.Altype)
                    .HasMaxLength(50)
                    .HasColumnName("ALType")
                    .HasComment("类型");

                entity.Property(e => e.Aluid)
                    .HasMaxLength(32)
                    .HasColumnName("ALUID")
                    .HasComment("用户ID");

                entity.Property(e => e.Alversion)
                    .HasMaxLength(10)
                    .HasColumnName("ALVersion")
                    .HasComment("记录版本：管理端/客户端");
            });

            modelBuilder.Entity<SysDepartment>(entity =>
            {
                entity.HasKey(e => e.Did)
                    .HasName("PRIMARY");

                entity.ToTable("sys_department");

                entity.UseCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.Did)
                    .HasMaxLength(32)
                    .HasColumnName("DID")
                    .HasComment("部门ID")
                    .UseCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.DcreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("DCreateTime")
                    .HasComment("添加时间");

                entity.Property(e => e.Ddesc)
                    .HasMaxLength(255)
                    .HasColumnName("DDesc")
                    .HasComment("备用");

                entity.Property(e => e.Dexplain)
                    .HasMaxLength(255)
                    .HasColumnName("DExplain")
                    .HasComment("描述");

                entity.Property(e => e.Dicon)
                    .HasMaxLength(50)
                    .HasColumnName("DIcon")
                    .HasComment("图标代码");

                entity.Property(e => e.DisBan)
                    .HasColumnName("DIsBan")
                    .HasComment("是否禁用");

                entity.Property(e => e.Dlv)
                    .HasColumnName("DLv")
                    .HasComment("部门等级");

                entity.Property(e => e.Dname)
                    .HasMaxLength(50)
                    .HasColumnName("DName")
                    .HasComment("部门名称");

                entity.Property(e => e.Dno)
                    .HasColumnName("DNo")
                    .HasComment("序号");

                entity.Property(e => e.Dparent)
                    .HasMaxLength(32)
                    .HasColumnName("DParent")
                    .HasComment("上级组织ID");
            });

            modelBuilder.Entity<SysDepartmentDuty>(entity =>
            {
                entity.HasKey(e => e.Ddid)
                    .HasName("PRIMARY");

                entity.ToTable("sys_department_duties");

                entity.UseCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.Ddid)
                    .HasMaxLength(32)
                    .HasColumnName("DDID")
                    .HasComment("ID")
                    .UseCollation("utf8mb4_0900_ai_ci");

                entity.Property(e => e.DdcreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("DDCreateTime")
                    .HasComment("时间");

                entity.Property(e => e.DddeptId)
                    .HasMaxLength(32)
                    .HasColumnName("DDDeptID")
                    .HasComment("部门ID");

                entity.Property(e => e.DddutyId)
                    .HasMaxLength(32)
                    .HasColumnName("DDDutyID")
                    .HasComment("组织ID");
            });

            modelBuilder.Entity<SysDuty>(entity =>
            {
                entity.HasKey(e => e.Did)
                    .HasName("PRIMARY");

                entity.ToTable("sys_duties");

                entity.UseCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.Did)
                    .HasMaxLength(32)
                    .HasColumnName("DID")
                    .HasComment("职务ID");

                entity.Property(e => e.DcreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("DCreateTime")
                    .HasComment("添加时间");

                entity.Property(e => e.Ddesc)
                    .HasMaxLength(255)
                    .HasColumnName("DDesc")
                    .HasComment("备用");

                entity.Property(e => e.Dexplain)
                    .HasMaxLength(255)
                    .HasColumnName("DExplain")
                    .HasComment("描述");

                entity.Property(e => e.DisBan)
                    .HasColumnName("DIsBan")
                    .HasComment("是否禁用");

                entity.Property(e => e.Dlv)
                    .HasColumnName("DLv")
                    .HasComment("职务等级");

                entity.Property(e => e.Dname)
                    .HasMaxLength(50)
                    .HasColumnName("DName")
                    .HasComment("职务名称");
            });

            modelBuilder.Entity<SysErrorLog>(entity =>
            {
                entity.HasKey(e => e.Elid)
                    .HasName("PRIMARY");

                entity.ToTable("sys_error_logs");

                entity.HasComment("错误日志表")
                    .UseCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.Elid)
                    .HasMaxLength(32)
                    .HasColumnName("ELID");

                entity.Property(e => e.Elapi)
                    .HasMaxLength(200)
                    .HasColumnName("ELApi")
                    .HasComment("引发错误的接口地址");

                entity.Property(e => e.ElcreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("ELCreateTime")
                    .HasComment("操作时间");

                entity.Property(e => e.Eldesc)
                    .HasMaxLength(255)
                    .HasColumnName("ELDesc")
                    .HasComment("备用");

                entity.Property(e => e.Elip)
                    .HasMaxLength(20)
                    .HasColumnName("ELIp")
                    .HasComment("请求IP");

                entity.Property(e => e.Elmessage)
                    .HasMaxLength(999)
                    .HasColumnName("ELMessage")
                    .HasComment("错误消息");

                entity.Property(e => e.Elparams)
                    .HasMaxLength(999)
                    .HasColumnName("ELParams")
                    .HasComment("本次请求的参数");

                entity.Property(e => e.Eluid)
                    .HasMaxLength(32)
                    .HasColumnName("ELUID")
                    .HasComment("用户ID");
            });

            modelBuilder.Entity<SysLoginLog>(entity =>
            {
                entity.HasKey(e => e.Llid)
                    .HasName("PRIMARY");

                entity.ToTable("sys_login_logs");

                entity.HasComment("登录日志")
                    .HasCharSet("utf8mb3")
                    .UseCollation("utf8mb3_unicode_ci");

                entity.Property(e => e.Llid)
                    .HasMaxLength(32)
                    .HasColumnName("LLID")
                    .HasComment("ID");

                entity.Property(e => e.Llcode)
                    .HasMaxLength(32)
                    .HasColumnName("LLCode")
                    .HasComment("生成的凭据");

                entity.Property(e => e.LlcreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("LLCreateTime")
                    .HasComment("登录时间");

                entity.Property(e => e.Llexplain)
                    .HasMaxLength(200)
                    .HasColumnName("LLExplain")
                    .HasComment("描述");

                entity.Property(e => e.Llip)
                    .HasMaxLength(99)
                    .HasColumnName("LLIP")
                    .HasComment("登录IP");

                entity.Property(e => e.Llresult)
                    .HasColumnName("LLResult")
                    .HasComment("登录结果");

                entity.Property(e => e.Lltype)
                    .HasMaxLength(50)
                    .HasColumnName("LLType")
                    .HasComment("登录类型");

                entity.Property(e => e.Lluid)
                    .HasMaxLength(32)
                    .HasColumnName("LLUID")
                    .HasComment("用户ID");
            });

            modelBuilder.Entity<SysRight>(entity =>
            {
                entity.HasKey(e => e.Rid)
                    .HasName("PRIMARY");

                entity.ToTable("sys_rights");

                entity.HasComment("权限表")
                    .UseCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.Rid)
                    .HasMaxLength(32)
                    .HasColumnName("RID")
                    .HasComment("ID");

                entity.Property(e => e.RcreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("RCreateTime")
                    .HasComment("添加时间");

                entity.Property(e => e.Rdesc)
                    .HasMaxLength(255)
                    .HasColumnName("RDesc")
                    .HasComment("备用");

                entity.Property(e => e.Rexplain)
                    .HasMaxLength(99)
                    .HasColumnName("RExplain")
                    .HasComment("描述");

                entity.Property(e => e.Ricon)
                    .HasMaxLength(99)
                    .HasColumnName("RIcon")
                    .HasComment("图标");

                entity.Property(e => e.RisBan)
                    .HasColumnName("RIsBan")
                    .HasComment("是否已禁用");

                entity.Property(e => e.RisDel)
                    .HasColumnName("RIsDel")
                    .HasComment("是否删除");

                entity.Property(e => e.RisMenu)
                    .HasColumnName("RIsMenu")
                    .HasComment("是否会出现在菜单");

                entity.Property(e => e.RisPublic)
                    .HasColumnName("RIsPublic")
                    .HasComment("是否公开权限");

                entity.Property(e => e.RisPublish)
                    .HasColumnName("RIsPublish")
                    .HasComment("是否发布");

                entity.Property(e => e.Rname)
                    .HasMaxLength(20)
                    .HasColumnName("RName")
                    .HasComment("名chen/菜单名");

                entity.Property(e => e.Rno)
                    .HasColumnName("RNo")
                    .HasComment("序号");

                entity.Property(e => e.RparentRid)
                    .HasMaxLength(32)
                    .HasColumnName("RParentRID")
                    .HasComment("上级权限ID");

                entity.Property(e => e.Rstate)
                    .HasColumnName("RState")
                    .HasComment("状态");

                entity.Property(e => e.Rurl)
                    .HasMaxLength(50)
                    .HasColumnName("RUrl")
                    .HasComment("地址");
            });

            modelBuilder.Entity<SysRightConfig>(entity =>
            {
                entity.HasKey(e => e.Rcid)
                    .HasName("PRIMARY");

                entity.ToTable("sys_right_config");

                entity.HasComment("权限-配置表")
                    .UseCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.Rcid)
                    .HasMaxLength(32)
                    .HasColumnName("RCID")
                    .HasComment("ID");

                entity.Property(e => e.Rccount)
                    .HasColumnName("RCCount")
                    .HasComment("包含权限数量");

                entity.Property(e => e.RccreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("RCCreateTime")
                    .HasComment("创建时间");

                entity.Property(e => e.Rcdesc)
                    .HasMaxLength(255)
                    .HasColumnName("RCDesc")
                    .HasComment("备用");

                entity.Property(e => e.RcisBan)
                    .HasColumnName("RCIsBan")
                    .HasComment("是否禁用");

                entity.Property(e => e.RcisPublish)
                    .HasColumnName("RCIsPublish")
                    .HasComment("是否发布");

                entity.Property(e => e.Rcname)
                    .HasMaxLength(20)
                    .HasColumnName("RCName")
                    .HasComment("配置名");

                entity.Property(e => e.Rcstate)
                    .HasColumnName("RCState")
                    .HasComment("状态");
            });

            modelBuilder.Entity<SysRightConfigDetail>(entity =>
            {
                entity.HasKey(e => e.Rcdid)
                    .HasName("PRIMARY");

                entity.ToTable("sys_right_config_details");

                entity.HasComment("权限配置关联表")
                    .UseCollation("utf8mb4_general_ci");

                entity.Property(e => e.Rcdid)
                    .HasMaxLength(32)
                    .HasColumnName("RCDID")
                    .HasComment("配置详情ID");

                entity.Property(e => e.RcdcreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("RCDCreateTime")
                    .HasComment("时间");

                entity.Property(e => e.Rcdrcid)
                    .HasMaxLength(999)
                    .HasColumnName("RCDRCID")
                    .HasComment("配置ID");

                entity.Property(e => e.Rcdrid)
                    .HasMaxLength(32)
                    .HasColumnName("RCDRID")
                    .HasComment("权限ID");
            });

            modelBuilder.Entity<SysRightConfigOrg>(entity =>
            {
                entity.HasKey(e => e.Rcoid)
                    .HasName("PRIMARY");

                entity.ToTable("sys_right_config_org");

                entity.Property(e => e.Rcoid)
                    .HasMaxLength(32)
                    .HasColumnName("RCOID");

                entity.Property(e => e.RcocreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("RCOCreateTime");

                entity.Property(e => e.RcodeptId)
                    .HasMaxLength(32)
                    .HasColumnName("RCODeptID");

                entity.Property(e => e.RcodutyId)
                    .HasMaxLength(32)
                    .HasColumnName("RCODutyID");

                entity.Property(e => e.RcoisAllDuties).HasColumnName("RCOIsAllDuties");

                entity.Property(e => e.RcoisPublish).HasColumnName("RCOIsPublish");

                entity.Property(e => e.Rcorcid)
                    .HasMaxLength(32)
                    .HasColumnName("RCORCID");
            });

            modelBuilder.Entity<SysUploadFile>(entity =>
            {
                entity.HasKey(e => e.Ufid)
                    .HasName("PRIMARY");

                entity.ToTable("sys_upload_files");

                entity.UseCollation("utf8mb4_general_ci");

                entity.Property(e => e.Ufid)
                    .HasMaxLength(32)
                    .HasColumnName("UFID")
                    .HasComment("文件ID");

                entity.Property(e => e.UfcreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("UFCreateTime")
                    .HasComment("上传时间");

                entity.Property(e => e.Ufdesc)
                    .HasMaxLength(255)
                    .HasColumnName("UFDesc");

                entity.Property(e => e.UfisBan)
                    .HasColumnName("UFIsBan")
                    .HasComment("是否禁用");

                entity.Property(e => e.Ufname)
                    .HasMaxLength(32)
                    .HasColumnName("UFName")
                    .HasComment("文件名");

                entity.Property(e => e.Ufpath)
                    .HasMaxLength(999)
                    .HasColumnName("UFPath")
                    .HasComment("文件地址");

                entity.Property(e => e.Ufsize)
                    .HasColumnName("UFSize")
                    .HasComment("文件大小,单位B");

                entity.Property(e => e.Uftype)
                    .HasMaxLength(50)
                    .HasColumnName("UFType")
                    .HasComment("文件类型");

                entity.Property(e => e.UfuseCount)
                    .HasColumnName("UFUseCount")
                    .HasComment("使用次数");
            });

            modelBuilder.Entity<SysUser>(entity =>
            {
                entity.HasKey(e => e.Uid)
                    .HasName("PRIMARY");

                entity.ToTable("sys_users");

                entity.HasComment("用户表")
                    .HasCharSet("utf8mb3")
                    .UseCollation("utf8mb3_unicode_ci");

                entity.HasIndex(e => e.Uaccount, "UAccount")
                    .IsUnique();

                entity.Property(e => e.Uid)
                    .HasMaxLength(32)
                    .HasColumnName("UID")
                    .HasComment("用户ID")
                    .UseCollation("utf8mb4_0900_ai_ci")
                    .HasCharSet("utf8mb4");

                entity.Property(e => e.Uaccount)
                    .HasMaxLength(11)
                    .HasColumnName("UAccount")
                    .HasComment("账号/电话");

                entity.Property(e => e.UcreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("UCreateTime")
                    .HasComment("创建时间");

                entity.Property(e => e.Udept)
                    .HasMaxLength(32)
                    .HasColumnName("UDept")
                    .HasComment("部门ID");

                entity.Property(e => e.Udesc)
                    .HasMaxLength(255)
                    .HasColumnName("UDesc")
                    .HasComment("备用字段");

                entity.Property(e => e.Uduty)
                    .HasMaxLength(32)
                    .HasColumnName("UDuty")
                    .HasComment("职务/岗位ID");

                entity.Property(e => e.Ugender)
                    .HasMaxLength(10)
                    .HasColumnName("UGender")
                    .HasComment("性别");

                entity.Property(e => e.UisActive)
                    .HasColumnName("UIsActive")
                    .HasComment("是否激活");

                entity.Property(e => e.UisBan)
                    .HasColumnName("UIsBan")
                    .HasComment("是否禁用");

                entity.Property(e => e.Uname)
                    .HasMaxLength(10)
                    .HasColumnName("UName")
                    .HasComment("姓名");

                entity.Property(e => e.UopenId)
                    .HasMaxLength(50)
                    .HasColumnName("UOpenID")
                    .HasComment("小程序OPENID");

                entity.Property(e => e.Upassword)
                    .HasMaxLength(32)
                    .HasColumnName("UPassword")
                    .HasComment("密码");

                entity.Property(e => e.Usalt).HasMaxLength(255);
            });

            modelBuilder.Entity<SysUserInfo>(entity =>
            {
                entity.HasKey(e => e.Uid)
                    .HasName("PRIMARY");

                entity.ToTable("sys_user_info");

                entity.HasComment("用户信息表")
                    .UseCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.Uid)
                    .HasMaxLength(32)
                    .HasColumnName("UID")
                    .HasComment("用户ID");

                entity.Property(e => e.Ubirthday)
                    .HasColumnType("datetime")
                    .HasColumnName("UBirthday")
                    .HasComment("生日");

                entity.Property(e => e.UcreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("UCreateTime")
                    .HasComment("添加时间");

                entity.Property(e => e.Udesc)
                    .HasMaxLength(255)
                    .HasColumnName("UDesc")
                    .HasComment("备用");

                entity.Property(e => e.Ugender)
                    .HasMaxLength(2)
                    .HasColumnName("UGender")
                    .IsFixedLength()
                    .HasComment("性别");

                entity.Property(e => e.UlastTime)
                    .HasColumnType("datetime")
                    .HasColumnName("ULastTime")
                    .HasComment("最后修改时间");

                entity.Property(e => e.Unick)
                    .HasMaxLength(20)
                    .HasColumnName("UNick")
                    .HasComment("昵称");

                entity.Property(e => e.Uphone)
                    .HasMaxLength(11)
                    .HasColumnName("UPhone")
                    .IsFixedLength()
                    .HasComment("电话");
            });

            modelBuilder.Entity<SysUserPoint>(entity =>
            {
                entity.HasKey(e => e.Upid)
                    .HasName("PRIMARY");

                entity.ToTable("sys_user_point");

                entity.HasComment("用户积分表")
                    .UseCollation("utf8mb4_general_ci");

                entity.Property(e => e.Upid)
                    .HasMaxLength(32)
                    .HasColumnName("UPID")
                    .HasComment("用户ID");

                entity.Property(e => e.Updesc)
                    .HasMaxLength(255)
                    .HasColumnName("UPDesc")
                    .HasComment("备用");

                entity.Property(e => e.UplastTime)
                    .HasColumnType("datetime")
                    .HasColumnName("UPLastTime")
                    .HasComment("最后获取或消耗积分的时间");

                entity.Property(e => e.Uppoint)
                    .HasColumnName("UPPoint")
                    .HasComment("累计积分");

                entity.Property(e => e.UpusePoint)
                    .HasColumnName("UPUsePoint")
                    .HasComment("消耗积分");
            });

            modelBuilder.Entity<SysUserPointhistory>(entity =>
            {
                entity.HasKey(e => e.Uphid)
                    .HasName("PRIMARY");

                entity.ToTable("sys_user_pointhistory");

                entity.HasComment("用户积分历史详情")
                    .UseCollation("utf8mb4_general_ci");

                entity.Property(e => e.Uphid)
                    .HasMaxLength(32)
                    .HasColumnName("UPHID")
                    .HasComment("用户积分历史详情ID");

                entity.Property(e => e.UphcreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("UPHCreateTime")
                    .HasComment("获取时间");

                entity.Property(e => e.Uphexplain)
                    .HasMaxLength(100)
                    .HasColumnName("UPHExplain")
                    .HasComment("描述");

                entity.Property(e => e.Uphpoint)
                    .HasColumnName("UPHPoint")
                    .HasComment("获取或消耗积分");

                entity.Property(e => e.UphrelationId)
                    .HasMaxLength(32)
                    .HasColumnName("UPHRelationID")
                    .HasComment("对应ID");

                entity.Property(e => e.Uphupid)
                    .HasMaxLength(32)
                    .HasColumnName("UPHUPID")
                    .HasComment("用户积分ID");

                entity.Property(e => e.Uptype)
                    .HasColumnName("UPType")
                    .HasComment("积分获取类型");
            });

            modelBuilder.Entity<SysUserRight>(entity =>
            {
                entity.HasKey(e => e.Urid)
                    .HasName("PRIMARY");

                entity.ToTable("sys_user_rights");

                entity.HasComment("用户-权限-关联表")
                    .UseCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.Urid)
                    .HasMaxLength(32)
                    .HasColumnName("URID")
                    .HasComment("ID");

                entity.Property(e => e.UrbeginTime)
                    .HasColumnType("datetime")
                    .HasColumnName("URBeginTime")
                    .HasComment("权限生效时间");

                entity.Property(e => e.UrcreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("URCreateTime")
                    .HasComment("添加时间");

                entity.Property(e => e.Urdesc)
                    .HasMaxLength(255)
                    .HasColumnName("URDesc")
                    .HasComment("备用");

                entity.Property(e => e.UroutTime)
                    .HasColumnType("datetime")
                    .HasColumnName("UROutTime")
                    .HasComment("权限过期时间");

                entity.Property(e => e.Urrid)
                    .HasMaxLength(32)
                    .HasColumnName("URRID")
                    .HasComment("权限ID");

                entity.Property(e => e.Uruid)
                    .HasMaxLength(32)
                    .HasColumnName("URUID")
                    .HasComment("用户ID");
            });

            modelBuilder.Entity<SysVerify>(entity =>
            {
                entity.HasKey(e => e.Vid)
                    .HasName("PRIMARY");

                entity.ToTable("sys_verify");

                entity.HasComment("验证码")
                    .UseCollation("utf8mb4_unicode_ci");

                entity.Property(e => e.Vid)
                    .HasMaxLength(32)
                    .HasColumnName("VID")
                    .HasComment("ID");

                entity.Property(e => e.Vcode)
                    .HasMaxLength(8)
                    .HasColumnName("VCode")
                    .HasComment("发送的验证码");

                entity.Property(e => e.VcreateTime)
                    .HasColumnType("datetime")
                    .HasColumnName("VCreateTime")
                    .HasComment("创建时间");

                entity.Property(e => e.Vdesc)
                    .HasMaxLength(255)
                    .HasColumnName("VDesc")
                    .HasComment("备用");

                entity.Property(e => e.VisUse)
                    .HasColumnName("VIsUse")
                    .HasComment("是否使用");

                entity.Property(e => e.VoutTime)
                    .HasColumnType("datetime")
                    .HasColumnName("VOutTime")
                    .HasComment("过期时间");

                entity.Property(e => e.Vphone)
                    .HasMaxLength(11)
                    .HasColumnName("VPhone")
                    .HasComment("电话");

                entity.Property(e => e.VuseTime)
                    .HasColumnType("datetime")
                    .HasColumnName("VUseTime")
                    .HasComment("使用时间");
            });

            OnModelCreatingPartial(modelBuilder);
        }

        partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
    }
}
